<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.flying.dcss.viewmodel.impl.CommentListViewModel"%>
<%@page import="com.flying.dcss.app.SessionName"%>
<%@page import="com.flying.dcss.app.CommonHelper"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	List<CommentListViewModel> models = (List<CommentListViewModel>) request
			.getAttribute(SessionName.CommentListSession);
	if (models == null) {
		return;
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>Comment</title>
		<link rel="stylesheet" href="style/css18.css" />
		<link rel="stylesheet" href="style/advice.css" type="text/css" />
		<style type="text/css">
.Info {
	border: 2px #00ffff solid;
	background-color: white;
	border-radius: 10px;
	font-size: 20px;
	height: 120px;
	width: 780px;
	z-index: -1px;
	display: none;
}
</style>

	</head>

	<body>
		<s:form name="addQuestion" action="comment/addQuestion.do"
			method="post">
			<div>
				<div>
					<dl>
						<dt style="margin: 20px 0">
							您的留言板
						</dt>
					</dl>


					<s:textfield name="question.content"
						cssStyle="width:780px;height:100px" />
					<span> <s:submit cssStyle="float:right" type="submit"
							value="Submit" cssClass="btn" /> </span>
				</div>
			</div>
		</s:form>

		<br />
		<br />
		<br />
		<%
			for (CommentListViewModel item : models) {
				if (item.getQuestion().getIsReply()) {
		%>
		<div class="statusInfo">
			<div>
				<span><img src="../images/icon_approve.png"
						style="margin-left: 10px;" /> </span>
				<span class="leftWord" style="margin-left: 10px">（已经解决）</span>
				<span><a class="close" href="">X</a> </span>
				<span><a class="rightWord" href="">显示详细</a> </span>
			</div>
		</div>
		<div class="Info" style="display: block">
			<div>
				<img src="images/quesed.gif" />
				<span style="margin-left: 10px"><%=item.getQuestionUser().getUsername()%>:</span>
				<br />
				<span style="margin-left: 40px"><%=item.getQuestion().getContent()%></span>
				<span
					style="float: right; position: relative; top: -20px; left: -10px;"><%=CommonHelper.getShortDate(item.getQuestion()
							.getCreateTime())%></span>
				<br />
				<img src="images/ansed.gif" />
				<span style="margin-left: 10px"><%=item.getAnswerUser().getUsername()%>:</span>
				<br />
				<span style="margin-left: 40px; color: red"><%=item.getAnswer().getContent()%></span>
				<span
					style="float: right; position: relative; top: -20px; left: -10px;"><%=CommonHelper.getShortDate(item.getAnswer()
							.getCreateTime())%></span>
			</div>
			<div class="position">
				<a href="">关注</a>
			</div>
		</div>
		<%
			} else {
		%>

		<div class="ErroInfo">
			<div>
				<span><img src="../images/icon_error.png"
						style="margin-left: 10px;" /> </span>
				<span class="RedWord" style="margin-left: 10px">（未解决）</span>
				<span><a class="close" href="">X</a> </span>
				<span><a class="rightWord" href="">显示详细</a> </span>
			</div>
		</div>
		<div class="Info" style="display: block">
			<div>
				<img src="images/quesed.gif" />
				<span style="margin-left: 10px"><%=item.getQuestionUser().getUsername()%>：</span>
				<br />
				<span style="margin-left: 40px"><%=item.getQuestion().getContent()%></span>
				<span
					style="float: right; position: relative; top: -20px; left: -10px;"><%=CommonHelper.getShortDate(item.getQuestion()
							.getCreateTime())%></span>
			</div>
			<div class="position">
				<a href="">关注</a>
			</div>
		</div>
		<%
			}
			}
		%>
		<script language="javascript" type="text/javascript">
var hl = document.getElementById("high3");
hl.setAttribute("id", "active2");
</script>
	</body>
</html>
